<template>
  <div class="home-container">


    <!-- 主要内容区域 -->
    <div class="main-content">
      <!-- 英雄区域 -->
      <div class="hero-section">
        <div class="hero-content">
          <h1 class="hero-title">溯源每一粒粮食<br>守护每一份健康</h1>
          <p class="hero-subtitle">全程可视化溯源，让每一份农产品都有迹可循</p>
          <div class="hero-buttons">
            <a class="hero-button primary" href='http://59.110.91.35/showall/firstpage' target="_blank">立即体验</a>
            <a class="hero-button secondary" href='https://weixiaozhi.org.cn/chat' target="_blank">了解更多</a>
            <a class="hero-button secondary" href='http://59.110.91.35:5000/#/login' target="_blank">前往区块管理平台<br>(管理员账号:admin 密码:1029hzb2004S)</a>

          </div>
        </div>
        <div class="hero-visual">
          <div class="floating-card card-1">
            <div class="card-icon icon-1"></div>
            <div class="card-text">产地溯源</div>
          </div>
          <div class="floating-card card-2">
            <div class="card-icon icon-2"></div>
            <div class="card-text">质量检测</div>
          </div>
        </div>
      </div>

      <!-- 数据展示区域 -->
      <div class="data-section">
        <div class="section-title">平台数据概览</div>
        <div class="data-cards">
          <div class="data-card" v-for="(data, index) in dataCards" :key="index">
            <div class="data-number">{{ data.number }}</div>
            <div class="data-label">{{ data.label }}</div>
            <div class="data-icon" :class="`icon-${index+1}`"></div>
          </div>
        </div>
      </div>

      <!-- 特色功能区域 -->
      <div class="features-section">
        <div class="section-title">核心功能特色</div>
        <div class="features-container">
          <div class="feature-card" v-for="(feature, index) in features" :key="index">
            <div class="feature-icon" :class="`feature-icon-${index+1}`"></div>
            <h3 class="feature-title">{{ feature.title }}</h3>
            <p class="feature-desc">{{ feature.description }}</p>
            <div class="feature-more">了解更多 →</div>
          </div>
        </div>
      </div>

      <!-- 溯源流程展示 -->
      <div class="process-section">
        <div class="section-title">溯源流程</div>
        <div class="process-container">
          <div class="process-step" v-for="(step, index) in processSteps" :key="index">
            <div class="step-number">{{ index + 1 }}</div>
            <div class="step-icon" :class="`step-icon-${index+1}`"></div>
            <div class="step-title">{{ step.title }}</div>
            <div class="step-desc">{{ step.description }}</div>
            <div class="step-line" v-if="index < processSteps.length - 1"></div>
          </div>
        </div>
      </div>
    </div>

    <!-- 底部区域 -->
    <div class="footer-section">
      <div class="footer-content">
        <div class="footer-column">
          <div class="footer-logo">农产品溯源平台</div>
          <div class="footer-desc">全程可视化溯源，守护食品安全</div>
        </div>
        <div class="footer-column">
          <div class="footer-title">快速链接</div>
          <div class="footer-links">
            <div class="footer-link" v-for="(link, index) in footerLinks" :key="index">{{ link }}</div>
          </div>
        </div>
        <div class="footer-column">
          <div class="footer-title">联系我们</div>
          <div class="footer-contact">
            <div class="contact-item">电话: XXX-XXX-XXXX</div>
            <div class="contact-item">邮箱: info@XXXX.com</div>
            <div class="contact-item">地址: 山东省潍坊市XXX</div>
          </div>
        </div>
      </div>
      <div class="footer-bottom">
        <div class="copyright">© 2025 农产品溯源平台 版权所有</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'HomePage',
  data() {
    return {
      hoverIndex: -1,
      menuItems: ['首页', '溯源查询', '产品中心', '数据统计', '关于我们'],
      dataCards: [
        { number: '12,568', label: '溯源产品' },
        { number: '3,842', label: '合作农户' },
        { number: '98.7%', label: '用户满意度' },
        { number: '24/7', label: '全天候监控' }
      ],
      features: [
        { title: '区块链溯源', description: '基于区块链技术，确保数据不可篡改，实现真实可靠的溯源信息' },
        { title: '智能检测', description: 'AI智能识别农产品质量，提供精准的检测报告与分析' },
        { title: '全程监控', description: '从种植到销售的全过程监控，让消费者了解产品每一个环节' },
        { title: '数据可视化', description: '直观展示农产品数据，通过图表分析提供决策支持' }
      ],
      processSteps: [
        { title: '种植记录', description: '记录农产品种植全过程信息' },
        { title: '采收加工', description: '记录采收、加工、包装等环节' },
        { title: '质量检测', description: '对产品进行多维度质量检测' },
        { title: '物流运输', description: '实时追踪产品物流运输状态' },
        { title: '销售溯源', description: '消费者扫码查询产品溯源信息' }
      ],
      footerLinks: ['关于我们', '服务条款', '隐私政策', '帮助中心', '合作伙伴']
    }
  }
}
</script>

<style scoped>
/* 全局样式 */
.home-container {
  width: 100%;
  min-height: 100vh;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
  color: #333;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  overflow-x: hidden;
}

/* 导航区域样式 */
.nav-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-content {
  width: 90%;
  max-width: 1400px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  border-radius: 8px;
  margin-right: 12px;
}

.logo-text {
  font-size: 20px;
  font-weight: 600;
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
}

.nav-item {
  margin: 0 20px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-item span {
  position: relative;
  padding-bottom: 5px;
}

.nav-item span.active {
  color: #2ecc71;
}

.nav-item span.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #2ecc71, #27ae60);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

/* 主要内容区域 */
.main-content {
  margin-top: 70px;
  padding: 40px 0;
}

/* 英雄区域样式 */
.hero-section {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 80px 0;
}

.hero-content {
  width: 50%;
}

.hero-title {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 20px;
  color: #7f8c8d;
  margin-bottom: 40px;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: 20px;
}

.hero-button {
  padding: 15px 30px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.hero-button.primary {
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.hero-button.primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(46, 204, 113, 0.4);
}

.hero-button.secondary {
  background: white;
  color: #2ecc71;
  border: 2px solid #2ecc71;
}

.hero-button.secondary:hover {
  background: #f8fffe;
}

.hero-visual {
  width: 45%;
  height: 400px;
  position: relative;
}

.floating-card {
  position: absolute;
  width: 180px;
  height: 180px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
}

.floating-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.card-1 {
  top: 0;
  left: 20px;
  animation: float 6s ease-in-out infinite;
}

.card-2 {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  animation: float 8s ease-in-out infinite;
  animation-delay: 1s;
}

.card-3 {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  animation: float 7s ease-in-out infinite;
  animation-delay: 2s;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
  100% { transform: translateY(0px); }
}

.card-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 15px;
  border-radius: 50%;
}

.icon-1 {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.icon-2 {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.icon-3 {
  background: linear-gradient(135deg, #f39c12 0%, #d35400 100%);
}

.card-text {
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
}

/* 数据展示区域 */
.data-section {
  width: 90%;
  max-width: 1400px;
  margin: 80px auto;
  text-align: center;
}

.section-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 50px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #2ecc71, #27ae60);
  border-radius: 2px;
}

.data-cards {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 30px;
}

.data-card {
  flex: 1;
  min-width: 200px;
  padding: 30px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.data-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.data-number {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.data-label {
  font-size: 16px;
  color: #7f8c8d;
}

.data-icon {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  opacity: 0.2;
  border-radius: 50%;
}

.icon-1 {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.icon-2 {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.icon-3 {
  background: linear-gradient(135deg, #f39c12 0%, #d35400 100%);
}

.icon-4 {
  background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

/* 特色功能区域 */
.features-section {
  width: 90%;
  max-width: 1400px;
  margin: 80px auto;
  text-align: center;
}

.features-container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 30px;
}

.feature-card {
  flex: 1;
  min-width: 250px;
  padding: 40px 30px;
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  text-align: left;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.feature-icon-1 {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.feature-icon-2 {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.feature-icon-3 {
  background: linear-gradient(135deg, #f39c12 0%, #d35400 100%);
}

.feature-icon-4 {
  background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.feature-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #2c3e50;
}

.feature-desc {
  font-size: 16px;
  color: #7f8c8d;
  line-height: 1.6;
  margin-bottom: 20px;
}

.feature-more {
  font-size: 16px;
  color: #2ecc71;
  cursor: pointer;
  transition: all 0.3s ease;
}

.feature-more:hover {
  color: #27ae60;
}

/* 溯源流程展示 */
.process-section {
  width: 90%;
  max-width: 1400px;
  margin: 80px auto;
  text-align: center;
}

.process-container {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-top: 60px;
}

.process-step {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-bottom: 15px;
}

.step-icon {
  width: 70px;
  height: 70px;
  border-radius: 15px;
  margin-bottom: 20px;
}

.step-icon-1 {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.step-icon-2 {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.step-icon-3 {
  background: linear-gradient(135deg, #f39c12 0%, #d35400 100%);
}

.step-icon-4 {
  background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.step-icon-5 {
  background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
}

.step-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #2c3e50;
}

.step-desc {
  font-size: 14px;
  color: #7f8c8d;
  max-width: 160px;
  text-align: center;
  line-height: 1.5;
}

.step-line {
  position: absolute;
  top: 20px;
  right: -50%;
  width: 100%;
  height: 2px;
  background: #e0e0e0;
  z-index: -1;
}

/* 底部区域 */
.footer-section {
  background: #2c3e50;
  color: white;
  padding: 60px 0 20px;
  margin-top: 80px;
}

.footer-content {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 40px;
}

.footer-column {
  flex: 1;
  min-width: 200px;
}

.footer-logo {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 15px;
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-desc {
  font-size: 16px;
  color: #bdc3c7;
  line-height: 1.6;
}

.footer-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: white;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link {
  font-size: 16px;
  color: #bdc3c7;
  cursor: pointer;
  transition: all 0.3s ease;
}

.footer-link:hover {
  color: #2ecc71;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-item {
  font-size: 16px;
  color: #bdc3c7;
}

.footer-bottom {
  width: 90%;
  max-width: 1400px;
  margin: 40px auto 0;
  padding-top: 20px;
  border-top: 1px solid #34495e;
  text-align: center;
}

.copyright {
  font-size: 14px;
  color: #95a5a6;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .hero-section {
    flex-direction: column;
    text-align: center;
  }
  
  .hero-content {
    width: 100%;
    margin-bottom: 40px;
  }
  
  .hero-visual {
    width: 100%;
    height: 300px;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
  
  .hero-title {
    font-size: 36px;
  }
  
  .hero-subtitle {
    font-size: 18px;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .data-cards, .features-container {
    flex-direction: column;
  }
  
  .process-container {
    flex-direction: column;
    gap: 30px;
  }
  
  .step-line {
    display: none;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}
</style>